import os
import time
from tkinter import *
from tkinter import ttk

win = Tk()
win.title("简易时钟")
win.geometry("500x500+500+200")
Label(win, text=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())), font=("宋体", 18)).pack()


def updateTime():
    ctime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))
    Label.config(text=ctime)
    win.update()  # 刷新时间
    Label.after(1000, updateTime)


Label.after(updateTime,ms=1000)
win.mainloop()
